<?php
	
	
class M_for_enrollment_id Extends MY_Model{
	
		private $_table = 'for_enrollment_id';

		public function __construct()
		{
			parent::__construct();
		}
		
		public function get_enrollment_id()
		{
			$sql = "SELECT for_e_id
					FROM for_enrollment_id 
					LIMIT 1";
			$query = $this->db->query($sql);
			return $query->num_rows() >=1 ? $query->row() : FALSE;
		}
		
		public function update_enrollment_id($data)
		{
			$this->db->truncate('for_enrollment_id');
			
			$this->db->insert('for_enrollment_id', $data); 
			
			return $this->db->affected_rows() >=1 ? TRUE : FALSE;
		}
		
		public function get_max()
		{
			$this->db->select_max('for_e_id');
			$query = $this->db->get('for_enrollment_id');
			return $query->num_rows() >=1 ? $query->row() : FALSE;
		}
}